package com.bnlr.lrparking.appui.order;

import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;

import com.bnlr.lrparking.R;
import com.bnlr.lrparking.base.BaseActivity;
import com.bnlr.lrparking.app.AppConfig;
import com.bnlr.lrparking.event.PaySuccee1Event;
import com.bnlr.lrparking.event.PaySucceeEvent;

import org.greenrobot.eventbus.EventBus;

/**
 * 支付成功
 *
 * Created by hp on 2017/8/21.
 */

public class PaySucceedActivity extends BaseActivity {

    private RelativeLayout rela_accomplish,tv_examine;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_paysuccess);
        initView();
    }

    private void initView(){
        rela_accomplish=(RelativeLayout)findViewById(R.id.rela_accomplish);
        rela_accomplish.setOnClickListener(this);
        tv_examine=(RelativeLayout) findViewById(R.id.tv_examine);
        tv_examine.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.rela_accomplish:
                //完成关闭其他的界面
                /**
                 * isList: 当是0的时候finish投资申请和订单支付界面，返回虚拟车位列表
                 * 当是1的时候finish订单支付界面，返回记录列表界面
                 * 当是2的时候finish投资申请和订单支付界面，返回记录列表界面
                 */
                if (AppConfig.getInstance().getString("isList", "").equals("0")) {
                    EventBus.getDefault().post(new PaySucceeEvent());
                    finish();
                }else if (AppConfig.getInstance().getString("isList", "").equals("1")){
                    EventBus.getDefault().post(new PaySuccee1Event());
                    finish();
                }
                break;
            case R.id.tv_examine://去查看

                break;
        }
    }
}
